package nodes

import (
	"gitee.com/zfd81/dbrs/sql"
	"vitess.io/vitess/go/sqltypes"
)

// ShowEngines is a node that shows the databases.
type ShowDatabases struct {
}

// NewShowDatabases creates a new show databases node.
func NewShowDatabases() *ShowDatabases {
	return new(ShowDatabases)
}

// Resolved implements the Resolvable interface.
func (p *ShowDatabases) Resolved() bool {
	return true
}

// Schema implements the Node interface.
func (*ShowDatabases) Schema() sql.Schema {
	return sql.Schema{
		{Name: "Database", Type: sqltypes.Text, Nullable: false},
		{Name: "Type", Type: sqltypes.Text},
		{Name: "Comment", Type: sqltypes.Text},
	}
}

func (p ShowDatabases) String() string {
	return "ShowDatabases"
}
